import { createBrowserRouter } from "react-router-dom";
import React from "react";

const Login = React.lazy(() => import("../pages/login.jsx").then(module => ({ default: module.Login })));
const Register = React.lazy(() => import("../pages/login.jsx").then(module => ({ default: module.Register })));
const Home = React.lazy(() => import("../pages/home.jsx"));
const Blog = React.lazy(() => import("../pages/blog.jsx"));
const User = React.lazy(() => import("../pages/user.jsx"));

const routes = createBrowserRouter([
    {
        path: "/",
        element: <Login />,
    },
    {
        path: "/register",
        element: <Register />,
    },
    {
        path: "/home",
        element: <Home />,
        children: [
            {
                path: "/home/blog",
                element: <Blog />,
            },
            {
                path: "/home/user",
                element: <User />,
            }
        ]
    }
]);
export default routes;